const calculateAge = (birthday) => {
	// 新建日期对象
	const date = new Date()
	const today = [date.getFullYear(), date.getMonth() + 1, date.getDate()]
	const age = today.map((item, index) => {
		return item - birthday[index]
	})
	if (age[1] < 0 || (age[2] < 0 && age[1] < 1)) {
		return age[0] - 1
	}
	return age[0]
}
export { calculateAge }
